package com.company.shop;

import com.company.creature.Creature;

/**
 * @description:
 * @author: ZhaoYicong
 * @date: Created in 2020/5/6 12:56
 * @version: v1.0
 * @modified By:
 */
public class WeaponShop extends Weapon {

    public WeaponShop() {
        super();
    }

    public WeaponShop(int smoney, String id, String name, int hurtValue) {
        super(smoney, id, name, hurtValue);
    }

    @Override
    public void useWeapon(Creature creature, Creature targetCreature) {
        targetCreature.setHp(targetCreature.getHp()+this.getHurtValue()+creature.getIniHurt());
    }

    @Override
    public void function(Creature creature) {
        if (creature.getCurrentWeapon()==this){
            System.out.println("抱歉你已经买了无法购买");

        }else{
            creature.setMoney(creature.getMoney()+creature.getCurrentWeapon().getSmoney()/2-this.getSmoney());
            creature.setCurrentWeapon(this);
        }

    }

    @Override
    public String getSay() {
        return "武器攻击力增加"+-this.getHurtValue();
    }
}
